/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author kaibiibrahim
 */
@Entity
@Table(name = "comd_calc")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ComdCalc.findAll", query = "SELECT c FROM ComdCalc c"),
    @NamedQuery(name = "ComdCalc.findById", query = "SELECT c FROM ComdCalc c WHERE c.id = :id"),
    @NamedQuery(name = "ComdCalc.findByLargeur", query = "SELECT c FROM ComdCalc c WHERE c.largeur = :largeur"),
    @NamedQuery(name = "ComdCalc.findByHauteur", query = "SELECT c FROM ComdCalc c WHERE c.hauteur = :hauteur"),
    @NamedQuery(name = "ComdCalc.findByNbr", query = "SELECT c FROM ComdCalc c WHERE c.nbr = :nbr"),
    @NamedQuery(name = "ComdCalc.findByParpe", query = "SELECT c FROM ComdCalc c WHERE c.parpe = :parpe"),
    @NamedQuery(name = "ComdCalc.findByLourdi", query = "SELECT c FROM ComdCalc c WHERE c.lourdi = :lourdi")})
public class ComdCalc implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "largeur")
    private Double largeur;
    @Column(name = "hauteur")
    private Double hauteur;
    @Column(name = "nbr")
    private Integer nbr;
    @Column(name = "parpe")
    private Integer parpe;
    @Column(name = "lourdi")
    private Integer lourdi;
    @JoinColumn(name = "cmd_id", referencedColumnName = "id")
    @ManyToOne
    private Commande cmdId;

    public ComdCalc() {
    }

    public ComdCalc(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Double getLargeur() {
        return largeur;
    }

    public void setLargeur(Double largeur) {
        this.largeur = largeur;
    }

    public Double getHauteur() {
        return hauteur;
    }

    public void setHauteur(Double hauteur) {
        this.hauteur = hauteur;
    }

    public Integer getNbr() {
        return nbr;
    }

    public void setNbr(Integer nbr) {
        this.nbr = nbr;
    }

    public Integer getParpe() {
        return parpe;
    }

    public void setParpe(Integer parpe) {
        this.parpe = parpe;
    }

    public Integer getLourdi() {
        return lourdi;
    }

    public void setLourdi(Integer lourdi) {
        this.lourdi = lourdi;
    }

    public Commande getCmdId() {
        return cmdId;
    }

    public void setCmdId(Commande cmdId) {
        this.cmdId = cmdId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ComdCalc)) {
            return false;
        }
        ComdCalc other = (ComdCalc) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.ComdCalc[ id=" + id + " ]";
    }
    
}
